<template>
  <el-form-item :label="i18nt('designer.setting.gutterValue')">
    <el-input-number
      v-model="gutterValue"
      class="hide-spin-button"
      :min="0"
      style="width: 100%"
    />
  </el-form-item>
</template>

<script>
import i18n from "Yan/utils/i18n";

export default {
  name: "gutter-editor",
  mixins: [i18n],
  props: {
    designer: Object,
    optionModel: Object,
  },
  computed: {
    gutterValue: {
      get() {
        return this.optionModel["gutter"];
      },

      set(newValue) {
        if (!newValue || isNaN(newValue)) {
          this.optionModel.gutter = null;
        } else {
          this.optionModel.gutter = Number(newValue);
        }
      },
    },
  },
};
</script>

<style lang="scss" scoped>
li.col-item {
  list-style: none;

  span.col-span-title {
    display: inline-block;
    font-size: 13px;
    width: 120px;
  }

  .col-delete-button {
    margin-left: 6px;
  }
}
</style>
